diff options
Diffstat (limited to 'accel-pppd/ppp/ipv6cp_opt_intfid.c')
-rw-r--r-- | accel-pppd/ppp/ipv6cp_opt_intfid.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/accel-pppd/ppp/ipv6cp_opt_intfid.c b/accel-pppd/ppp/ipv6cp_opt_intfid.c index bc7fae8..fff7416 100644 --- a/accel-pppd/ppp/ipv6cp_opt_intfid.c +++ b/accel-pppd/ppp/ipv6cp_opt_intfid.c @@ -42,7 +42,7 @@ static void put_ipv6_item(struct ap_session *ses, struct ipv6db_item_t *ip6); struct ipaddr_option_t { struct ipv6cp_option_t opt; - int started:1; + unsigned int started:1; struct ppp_t *ppp; }; @@ -163,7 +163,8 @@ static uint64_t generate_intf_id(struct ppp_t *ppp) static uint64_t generate_peer_intf_id(struct ppp_t *ppp) { char str[4]; - int i, n; + int i; + unsigned int n; union { uint64_t intf_id; uint16_t addr16[4]; @@ -292,14 +293,14 @@ static uint64_t parse_intfid(const char *opt) uint16_t u16[4]; } u; - int n[4]; + unsigned int n[4]; int i; if (sscanf(opt, "%x:%x:%x:%x", &n[0], &n[1], &n[2], &n[3]) != 4) goto err; for (i = 0; i < 4; i++) { - if (n[i] < 0 || n[i] > 0xffff) + if (n[i] > 0xffff) goto err; u.u16[i] = htons(n[i]); } |