summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_network.c
diff options
context:
space:
mode:
authorAndrew Certain <certain@amazon.com>2012-12-04 22:43:42 +0100
committerScott Feldman <sfeldma@cumulusnetworks.com>2013-01-07 18:59:59 +0100
commit0798cee34f5c436cd2a4b6e1d9a1ca90eee94292 (patch)
tree1b2293b711a12d743a0cd814235589bc4ce8d84f /ospfd/ospf_network.c
parentospfd: Update nsm_change_state to static scope, as it is not called from else... (diff)
downloadfrr-0798cee34f5c436cd2a4b6e1d9a1ca90eee94292.tar.xz
frr-0798cee34f5c436cd2a4b6e1d9a1ca90eee94292.zip
ospfd: compile warning cleanups
A set of patches to clarify some comments as well as cleanup code that was causing warnings. After these patches, the code can be compiled with -Wall -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wcast-qual -Wextra -Wno-unused-parameter -Wno-missing-field-initializers (what is current in trunk plus -Wextra -Wno-unused-parameter -Wno-missing-field-initializers). Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_network.c')
-rw-r--r--ospfd/ospf_network.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c
index 3e326a8c3..900a5667d 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -228,7 +228,7 @@ ospf_sock_init (void)
}
void
-ospf_adjust_sndbuflen (struct ospf * ospf, int buflen)
+ospf_adjust_sndbuflen (struct ospf * ospf, unsigned int buflen)
{
int ret, newbuflen;
/* Check if any work has to be done at all. */
@@ -249,11 +249,11 @@ ospf_adjust_sndbuflen (struct ospf * ospf, int buflen)
*/
ret = setsockopt_so_sendbuf (ospf->fd, buflen);
newbuflen = getsockopt_so_sendbuf (ospf->fd);
- if (ret < 0 || newbuflen < buflen)
- zlog_warn ("%s: tried to set SO_SNDBUF to %d, but got %d",
+ if (ret < 0 || newbuflen < 0 || newbuflen < (int) buflen)
+ zlog_warn ("%s: tried to set SO_SNDBUF to %u, but got %d",
__func__, buflen, newbuflen);
if (newbuflen >= 0)
- ospf->maxsndbuflen = newbuflen;
+ ospf->maxsndbuflen = (unsigned int)newbuflen;
else
zlog_warn ("%s: failed to get SO_SNDBUF", __func__);
if (ospfd_privs.change (ZPRIVS_LOWER))