summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-12-08 13:26:14 +0300
committerDenis Ovsienko <infrastation@yandex.ru>2009-12-08 13:26:14 +0300
commitb0b709ab6656ba07f12fe0d256912dcabba19017 (patch)
tree2633ce43d4256af90e9a85d2f866b911418b7cf8
parent0342b76cfbfde2b6f45c4614e674d53987b1e9fa (diff)
zebra: fix more warnings in rtadv
* zebra/rtadv.c * rtadv_free(): remove unused function * rtadv_recv_packet(): break up cast/dereference to avoid compiler type pun warning * rtadv_read(): initialize ifindex, because compiler can't figure out that it is okay
-rw-r--r--zebra/rtadv.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 0bcdafb0..8cc3c4cb 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -87,12 +87,6 @@ rtadv_new (void)
return XCALLOC (MTYPE_TMP, sizeof (struct rtadv));
}
-static void
-rtadv_free (struct rtadv *rtadv)
-{
- XFREE (MTYPE_TMP, rtadv);
-}
-
static int
rtadv_recv_packet (int sock, u_char *buf, int buflen,
struct sockaddr_in6 *from, unsigned int *ifindex,
@@ -138,7 +132,10 @@ rtadv_recv_packet (int sock, u_char *buf, int buflen,
/* Incoming packet's hop limit. */
if (cmsgptr->cmsg_level == IPPROTO_IPV6 &&
cmsgptr->cmsg_type == IPV6_HOPLIMIT)
- *hoplimit = *((int *) CMSG_DATA (cmsgptr));
+ {
+ int *hoptr = (int *) CMSG_DATA (cmsgptr);
+ *hoplimit = *hoptr;
+ }
}
return ret;
}
@@ -467,7 +464,7 @@ rtadv_read (struct thread *thread)
int len;
u_char buf[RTADV_MSG_SIZE];
struct sockaddr_in6 from;
- unsigned int ifindex;
+ unsigned int ifindex = 0;
int hoplimit = -1;
sock = THREAD_FD (thread);