From 633abfbf7299725df20ab2865dbfca54f969f684 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 9 Jan 2013 13:35:04 +0100 Subject: [PATCH] kernel/netinet: Remove some unused variables. --- sys/netinet/ip_gre.c | 4 +--- sys/netinet/sctp_indata.c | 12 ++---------- sys/netinet/sctp_input.c | 5 ----- sys/netinet/sctp_output.c | 15 --------------- sys/netinet/sctp_pcb.c | 14 +++----------- sys/netinet/sctputil.c | 8 +------- 6 files changed, 7 insertions(+), 51 deletions(-) diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c index 09d67e6e4e..a7eb053bce 100644 --- a/sys/netinet/ip_gre.c +++ b/sys/netinet/ip_gre.c @@ -208,9 +208,7 @@ gre_mobile_input(struct mbuf **mp, int *offp, int proto) struct ip *ip = mtod(m, struct ip *); struct mobip_h *mip = mtod(m, struct mobip_h *); struct gre_softc *sc; - int msiz, hlen; - - hlen = *offp; + int msiz; if ((sc = gre_lookup(m, IPPROTO_MOBILE)) == NULL) { /* No matching tunnel or tunnel is down. */ diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 8be314bc11..bd8dbda8c7 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -1061,9 +1061,8 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, { struct mbuf *oper; u_int16_t nxt_todel; - u_int32_t cum_ackp1, last_tsn, prev_tsn, post_tsn; + u_int32_t cum_ackp1, prev_tsn, post_tsn; int tsize; - u_char last_flags; struct sctp_tmit_chunk *at, *prev, *next; prev = next = NULL; @@ -1245,8 +1244,6 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, sctppcbinfo.ipi_gencnt_chunk++; return; } else { - last_flags = at->rec.data.rcv_flags; - last_tsn = at->rec.data.TSN_seq; prev = at; if (TAILQ_NEXT(at, sctp_next) == NULL) { /* @@ -1694,7 +1691,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_tmit_chunk *chk; u_int32_t tsn, gap; struct mbuf *dmbuf; - int indx, the_len; + int the_len; u_int16_t strmno, strmseq; struct mbuf *oper; @@ -1809,7 +1806,6 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, } else { sctp_pegs[SCTP_RWND_DROPS]++; } - indx = *break_flag; *break_flag = 1; return (0); } @@ -3544,7 +3540,6 @@ sctp_handle_sack(struct sctp_sack_chunk *ch, struct sctp_tcb *stcb, unsigned int sack_length; uint32_t send_s; int some_on_streamwheel; - long j; int strike_enabled = 0, cnt_of_cacc = 0; int accum_moved = 0; int marking_allowed = 1; @@ -3598,7 +3593,6 @@ sctp_handle_sack(struct sctp_sack_chunk *ch, struct sctp_tcb *stcb, * 12) Assure we will SACK if in shutdown_recv state. */ - j = 0; sack_length = ntohs(ch->ch.chunk_length); if (sack_length < sizeof(struct sctp_sack_chunk)) { #ifdef SCTP_DEBUG @@ -4729,9 +4723,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, #endif for (i = 0; i < num_str; i++) { u_int16_t st; - unsigned char *xx; /* Convert */ - xx = (unsigned char *)&stseq[i]; st = ntohs(stseq[i].stream); stseq[i].stream = st; st = ntohs(stseq[i].sequence); diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 45d9009dbb..1e476cf6d8 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -509,8 +509,6 @@ static void sctp_handle_abort(struct sctp_abort_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net) { - struct sctp_inpcb *inp; - #ifdef SCTP_DEBUG if (sctp_debug_on & SCTP_DEBUG_INPUT2) { kprintf("sctp_handle_abort: handling ABORT\n"); @@ -526,7 +524,6 @@ sctp_handle_abort(struct sctp_abort_chunk *cp, /* notify user of the abort and clean up... */ sctp_abort_notification(stcb, 0); /* free the tcb */ - inp = stcb->sctp_ep; sctp_free_assoc(stcb->sctp_ep, stcb); #ifdef SCTP_DEBUG if (sctp_debug_on & SCTP_DEBUG_INPUT2) { @@ -1450,7 +1447,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, int init_offset, initack_offset, initack_limit; int retval; int error = 0; - u_int32_t old_tag; /* * find and validate the INIT chunk in the cookie (peer's info) * the INIT should start after the cookie-echo header struct @@ -1554,7 +1550,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, } /* process the INIT-ACK info (my info) */ - old_tag = asoc->my_vtag; asoc->my_vtag = ntohl(initack_cp->init.initiate_tag); asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index ff83aa9bf8..3c51740162 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -3241,7 +3241,6 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, struct ip *iph; struct mbuf *mat; uint16_t ptype, plen; - int err_at; uint8_t fnd; struct sctp_nets *net; @@ -3296,7 +3295,6 @@ sctp_are_there_new_addresses(struct sctp_association *asoc, } /* Ok so far lets munge through the rest of the packet */ mat = in_initpkt; - err_at = 0; sa_touse = NULL; offset += sizeof(struct sctp_init_chunk); phdr = sctp_get_next_param(mat, offset, ¶ms, sizeof(params)); @@ -4940,8 +4938,6 @@ sctp_sendall (struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, struct sc } } else { if ((m->m_flags & M_PKTHDR) == 0) { - struct mbuf *mat; - mat = m; ca->sndlen = 0; while(m) { ca->sndlen += m->m_len; @@ -6465,15 +6461,12 @@ sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net) */ struct sctp_tmit_chunk *chk; struct mbuf *m_asconf; - struct sctp_asconf_chunk *acp; - /* compose an ASCONF chunk, maximum length is PMTU */ m_asconf = sctp_compose_asconf(stcb); if (m_asconf == NULL) { return (-1); } - acp = mtod(m_asconf, struct sctp_asconf_chunk *); chk = (struct sctp_tmit_chunk *)SCTP_ZONE_GET(sctppcbinfo.ipi_zone_chunk); if (chk == NULL) { /* no memory */ @@ -7225,7 +7218,6 @@ int sctp_output(struct sctp_inpcb *inp, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *p, int flags) { - struct inpcb *ip_inp; struct sctp_inpcb *t_inp; struct sctp_tcb *stcb; struct sctp_nets *net; @@ -7240,7 +7232,6 @@ sctp_output(struct sctp_inpcb *inp, struct mbuf *m, struct sockaddr *addr, crit_enter(); queue_only = 0; - ip_inp = (struct inpcb *)inp; stcb = NULL; asoc = NULL; net = NULL; @@ -10080,7 +10071,6 @@ sctp_sosend(struct socket *so, #endif ) { - unsigned int sndlen; int error, use_rcvinfo; int queue_only = 0, queue_only_for_init=0; int un_sent = 0; @@ -10107,11 +10097,6 @@ sctp_sosend(struct socket *so, stcb = NULL; asoc = NULL; t_inp = inp = (struct sctp_inpcb *)so->so_pcb; - if (uio) - sndlen = uio->uio_resid; - else - sndlen = top->m_pkthdr.len; - crit_enter(); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 243fa0ec2f..bc2c35a7a1 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -963,8 +963,6 @@ sctp_pcb_findep(struct sockaddr *nam, int find_tcp_pool, int have_lock) */ struct sctp_inpcb *inp; struct sctppcbhead *head; - struct sockaddr_in *sin; - struct sockaddr_in6 *sin6; int lport; #ifdef SCTP_DEBUG if (sctp_debug_on & SCTP_DEBUG_PCB1) { @@ -974,10 +972,8 @@ sctp_pcb_findep(struct sockaddr *nam, int find_tcp_pool, int have_lock) } #endif if (nam->sa_family == AF_INET) { - sin = (struct sockaddr_in *)nam; lport = ((struct sockaddr_in *)nam)->sin_port; } else if (nam->sa_family == AF_INET6) { - sin6 = (struct sockaddr_in6 *)nam; lport = ((struct sockaddr_in6 *)nam)->sin6_port; } else { /* unsupported family */ @@ -2225,7 +2221,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate) * c) The hash of all associations. * d) finally the ep itself. */ - struct sctp_pcb *m; struct sctp_inpcb *inp_save; struct sctp_tcb *asoc, *nasoc; struct sctp_laddr *laddr, *nladdr; @@ -2258,7 +2253,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate) inp->pkt = NULL; } so = inp->sctp_socket; - m = &inp->sctp_ep; ip_pcb = &inp->ip_inp.inp; /* we could just cast the main * pointer here but I will * be nice :> (i.e. ip_pcb = ep;) @@ -2514,12 +2508,12 @@ struct sctp_nets * sctp_findnet(struct sctp_tcb *stcb, struct sockaddr *addr) { struct sctp_nets *net; +#if 0 struct sockaddr_in *sin; - struct sockaddr_in6 *sin6; + + /* why do we need to check the port for a nets list on an assoc? */ /* use the peer's/remote port for lookup if unspecified */ sin = (struct sockaddr_in *)addr; - sin6 = (struct sockaddr_in6 *)addr; -#if 0 /* why do we need to check the port for a nets list on an assoc? */ if (stcb->rport != sin->sin_port) { /* we cheat and just a sin for this test */ return (NULL); @@ -3870,7 +3864,6 @@ sctp_del_local_addr_ep(struct sctp_inpcb *inp, struct ifaddr *ifa) int sctp_add_local_addr_assoc(struct sctp_tcb *stcb, struct ifaddr *ifa) { - struct sctp_inpcb *inp; struct sctp_laddr *laddr; int error; @@ -3878,7 +3871,6 @@ sctp_add_local_addr_assoc(struct sctp_tcb *stcb, struct ifaddr *ifa) * the INP. May need to confirm/fix that if * we need it and is not the case. */ - inp = stcb->sctp_ep; if (ifa->ifa_addr->sa_family == AF_INET6) { struct in6_ifaddr *ifa6; ifa6 = (struct in6_ifaddr *)ifa; diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index af89207948..d92389d62d 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1880,7 +1880,6 @@ sctp_calculate_rto(struct sctp_tcb *stcb, * period (in value1/value2) return RTO in number of usecs. */ int calc_time = 0; - int o_calctime; unsigned int new_rto = 0; int first_measure = 0; struct timeval now; @@ -1943,7 +1942,6 @@ sctp_calculate_rto(struct sctp_tcb *stcb, new_rto = net->lastsa + 4 * net->lastsv; */ #endif - o_calctime = calc_time; /* this is Van Jacobson's integer version */ if (net->RTO) { calc_time -= (net->lastsa >> 3); @@ -2989,8 +2987,6 @@ void sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int error, struct mbuf *op_err) { - u_int32_t vtag; - if (stcb == NULL) { /* Got to have a TCB */ if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { @@ -3000,7 +2996,6 @@ sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb, } return; } - vtag = stcb->asoc.peer_vtag; /* notify the ulp */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) sctp_abort_notification(stcb, error); @@ -3271,7 +3266,7 @@ sctp_sbappendaddr_nocheck(struct signalsockbuf *ssb, struct sockaddr *asa, struc struct mbuf *control, u_int32_t tag, struct sctp_inpcb *inp) { - struct mbuf *m, *n, *nlast; + struct mbuf *m, *n; int cnt=0; if (m0 && (m0->m_flags & M_PKTHDR) == 0) @@ -3320,7 +3315,6 @@ sctp_sbappendaddr_nocheck(struct signalsockbuf *ssb, struct sockaddr *asa, struc SOCKBUF_LOCK(ssb); for (n = m; n; n = n->m_next) sballoc(&ssb->sb, n); - nlast = n; if (ssb->ssb_mb == NULL) { inp->sctp_vtag_first = tag; } -- 2.41.0