From: Brendan O'Dea Date: Mon, 12 Sep 2011 10:46:07 +0000 (+1000) Subject: clean up some compiler errors X-Git-Tag: 2.2.1-2fdn3.1~19^2^2~1^2 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/b939b00afdd2a5bbef84a415243c5b0fc7d50702?ds=sidebyside;hp=-c clean up some compiler errors --- b939b00afdd2a5bbef84a415243c5b0fc7d50702 diff --git a/Changes b/Changes index 2149c6d..decb16e 100644 --- a/Changes +++ b/Changes @@ -3,10 +3,11 @@ - Apply patch from Michael O to avoid sending multiple CDNs. - Apply patch from Cyril Elkaim to fix an issue with MacOS. - Apply patch from Geoffrey D. Bennett to fix retry of control packets. -- Apply patch from Geoffrey D. Bennett to fix handle RADIUS Class attribute. +- Apply patch from Geoffrey D. Bennett to handle RADIUS Class attribute. - Bump heartbeat version to handle Class entry in session (v6). - Re-arrange session struct to remove padding. - Update cluster code to handle v6 packets. Drop compatability for pre-v5. +- Clean up some compiler errors. * Mon Dec 18 2006 Brendan O'Dea 2.2.0 - Only poll clifd if successfully bound. diff --git a/cluster.c b/cluster.c index 66846d6..c6f7eee 100644 --- a/cluster.c +++ b/cluster.c @@ -514,7 +514,7 @@ void cluster_check_slaves(void) // void cluster_check_master(void) { - int i, count, tcount, bcount, high_unique_id = 0; + int i, count, high_unique_id = 0; int last_free = 0; clockt t = TIME; static int probed = 0; @@ -600,7 +600,7 @@ void cluster_check_master(void) // Count the highest used tunnel number as well. // config->cluster_highest_tunnelid = 0; - for (i = 0, tcount = 0; i < MAXTUNNEL; ++i) { + for (i = 0; i < MAXTUNNEL; ++i) { if (tunnel[i].state == TUNNELUNDEF) tunnel[i].state = TUNNELFREE; @@ -613,7 +613,7 @@ void cluster_check_master(void) // Count the highest used bundle number as well. // config->cluster_highest_bundleid = 0; - for (i = 0, bcount = 0; i < MAXBUNDLE; ++i) { + for (i = 0; i < MAXBUNDLE; ++i) { if (bundle[i].state == BUNDLEUNDEF) bundle[i].state = BUNDLEFREE; diff --git a/l2tpns.c b/l2tpns.c index 3b61951..394a323 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -1276,7 +1276,7 @@ static void processipout(uint8_t *buf, int len) if(session[s].bundle != 0 && bundle[session[s].bundle].num_of_links > 1) { bid = session[s].bundle; - s = bundle[bid].members[bundle[bid].current_ses = ++bundle[bid].current_ses % bundle[bid].num_of_links]; + s = bundle[bid].members[bundle[bid].current_ses = (bundle[bid].current_ses + 1) % bundle[bid].num_of_links]; t = session[s].tunnel; sp = &session[s]; LOG(4, s, t, "MPPP: (1)Session number becomes: %d\n", s); @@ -1299,8 +1299,8 @@ static void processipout(uint8_t *buf, int len) update_session_out_stat(s, sp, fraglen); remain -= fraglen; while (remain > last_fraglen) - { - s = b->members[b->current_ses = ++b->current_ses % num_of_links]; + { + s = b->members[b->current_ses = (b->current_ses + 1) % num_of_links]; t = session[s].tunnel; sp = &session[s]; LOG(4, s, t, "MPPP: (2)Session number becomes: %d\n", s); @@ -1311,7 +1311,7 @@ static void processipout(uint8_t *buf, int len) remain -= fraglen; } // send the last fragment - s = b->members[b->current_ses = ++b->current_ses % num_of_links]; + s = b->members[b->current_ses = (b->current_ses + 1) % num_of_links]; t = session[s].tunnel; sp = &session[s]; LOG(4, s, t, "MPPP: (2)Session number becomes: %d\n", s); @@ -1418,7 +1418,7 @@ static void processipv6out(uint8_t * buf, int len) if (session[s].bundle && bundle[session[s].bundle].num_of_links > 1) { bundleidt bid = session[s].bundle; - s = bundle[bid].members[bundle[bid].current_ses = ++bundle[bid].current_ses % bundle[bid].num_of_links]; + s = bundle[bid].members[bundle[bid].current_ses = (bundle[bid].current_ses + 1) % bundle[bid].num_of_links]; LOG(3, s, session[s].tunnel, "MPPP: Session number becomes: %u\n", s); } t = session[s].tunnel; @@ -1473,7 +1473,6 @@ static void send_ipout(sessionidt s, uint8_t *buf, int len) { sessiont *sp; tunnelidt t; - in_addr_t ip; uint8_t b[MAXETHER + 20]; @@ -1487,8 +1486,6 @@ static void send_ipout(sessionidt s, uint8_t *buf, int len) buf += 4; len -= 4; - ip = *(in_addr_t *)(buf + 16); - if (!session[s].ip) return; diff --git a/ppp.c b/ppp.c index bbd2244..ed12040 100644 --- a/ppp.c +++ b/ppp.c @@ -2369,7 +2369,7 @@ uint8_t *makeppp(uint8_t *b, int size, uint8_t *p, int l, sessionidt s, tunnelid if ((b - start) + l > size) { - LOG(2, s, t, "makeppp would overflow buffer (size=%d, header+payload=%d)\n", size, (b - start) + l); + LOG(2, s, t, "makeppp would overflow buffer (size=%d, header+payload=%ld)\n", size, (b - start) + l); return NULL; }