Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/rtadvd interface indexes are unsigned



details:   https://anonhg.NetBSD.org/src/rev/fa90a2a5754b
branches:  trunk
changeset: 960621:fa90a2a5754b
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 23 18:16:21 2021 +0000

description:
interface indexes are unsigned

diffstat:

 usr.sbin/rtadvd/if.c |  21 +++++++++++----------
 usr.sbin/rtadvd/if.h |  14 +++++++-------
 2 files changed, 18 insertions(+), 17 deletions(-)

diffs (110 lines):

diff -r 9d611ee21844 -r fa90a2a5754b usr.sbin/rtadvd/if.c
--- a/usr.sbin/rtadvd/if.c      Tue Mar 23 18:13:07 2021 +0000
+++ b/usr.sbin/rtadvd/if.c      Tue Mar 23 18:16:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.27 2021/03/22 18:41:11 christos Exp $ */
+/*     $NetBSD: if.c,v 1.28 2021/03/23 18:16:21 christos Exp $ */
 /*     $KAME: if.c,v 1.36 2004/11/30 22:32:01 suz Exp $        */
 
 /*
@@ -132,7 +132,7 @@
 
 /* give interface index and its old flags, then new flags returned */
 int
-if_getflags(int ifindex, int oifflags)
+if_getflags(unsigned int ifindex, int oifflags)
 {
        struct ifreq ifr;
        int s;
@@ -194,7 +194,8 @@
 #define SIN6(s) ((const struct sockaddr_in6 *)(s))
 #define SDL(s) ((const struct sockaddr_dl *)(s))
 char *
-get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter)
+get_next_msg(char *buf, char *lim, unsigned int ifindex, size_t *lenp,
+    int filter)
 {
        struct rt_msghdr *rtm;
        struct ifa_msghdr *ifam;
@@ -294,7 +295,7 @@
        return &SIN6(rti_info[RTAX_DST])->sin6_addr;
 }
 
-int
+unsigned int
 get_rtm_ifindex(const void *buf)
 {
        const struct rt_msghdr *rtm = buf;
@@ -306,20 +307,20 @@
        return SDL(rti_info[RTAX_GATEWAY])->sdl_index;
 }
 
-int
+unsigned int
 get_ifm_ifindex(const void *buf)
 {
        const struct if_msghdr *ifm = buf;
 
-       return (int)ifm->ifm_index;
+       return ifm->ifm_index;
 }
 
-int
+unsigned int
 get_ifam_ifindex(const void *buf)
 {
        const struct ifa_msghdr *ifam = buf;
 
-       return (int)ifam->ifam_index;
+       return ifam->ifam_index;
 }
 
 int
@@ -331,12 +332,12 @@
 }
 
 #ifdef RTM_IFANNOUNCE
-int
+unsigned int
 get_ifan_ifindex(const void *buf)
 {
        const struct if_announcemsghdr *ifan = buf;
 
-       return (int)ifan->ifan_index;
+       return ifan->ifan_index;
 }
 
 int
diff -r 9d611ee21844 -r fa90a2a5754b usr.sbin/rtadvd/if.h
--- a/usr.sbin/rtadvd/if.h      Tue Mar 23 18:13:07 2021 +0000
+++ b/usr.sbin/rtadvd/if.h      Tue Mar 23 18:16:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.12 2021/03/22 18:41:11 christos Exp $ */
+/*     $NetBSD: if.h,v 1.13 2021/03/23 18:16:21 christos Exp $ */
 /*     $KAME: if.h,v 1.12 2003/09/21 07:17:03 itojun Exp $     */
 
 /*
@@ -35,17 +35,17 @@
 struct nd_opt_hdr;
 struct sockaddr_dl *if_nametosdl(const char *);
 int if_getmtu(const char *);
-int if_getflags(int, int);
+int if_getflags(unsigned int, int);
 int lladdropt_length(struct sockaddr_dl *);
 void lladdropt_fill(struct sockaddr_dl *, struct nd_opt_hdr *);
-char *get_next_msg(char *, char *, int, size_t *, int);
+char *get_next_msg(char *, char *, unsigned int, size_t *, int);
 const struct in6_addr *get_addr(const void *);
-int get_rtm_ifindex(const void *);
-int get_ifm_ifindex(const void *);
-int get_ifam_ifindex(const void *);
+unsigned int get_rtm_ifindex(const void *);
+unsigned int get_ifm_ifindex(const void *);
+unsigned int get_ifam_ifindex(const void *);
 int get_ifm_flags(const void *);
 #ifdef RTM_IFANNOUNCE
-int get_ifan_ifindex(const void *);
+unsigned int get_ifan_ifindex(const void *);
 int get_ifan_what(const void *);
 #endif
 int get_prefixlen(const void *);



Home | Main Index | Thread Index | Old Index