another 4.2 UDP bug fix

RWS%mit-xx at sri-unix.UUCP RWS%mit-xx at sri-unix.UUCP
Sat Nov 5 06:31:00 AEST 1983


From:  Robert W. Scheifler <RWS at mit-xx>

In udp_input(), the code
          if (udpcksum) {
                    ui->ui_next = ui->ui_prev = 0;
                    ui->ui_x1 = 0;
                    ui->ui_len = htons((u_short)len);
                    if (ui->ui_sum = in_cksum(m, len + sizeof (struct ip))) {
                              udpstat.udps_badsum++;
                              m_freem(m);
                              return;
                    }
          }
should be changed to
          if (udpcksum && ui->ui_sum) {
                    register u_short csum = ui->ui_sum;

                    ui->ui_next = ui->ui_prev = 0;
                    ui->ui_x1 = 0;
                    ui->ui_len = htons((u_short)len);
                    ui->ui_sum = 0;
                    if (csum != in_cksum(m, len + sizeof (struct ip))) {
                              udpstat.udps_badsum++;
                              m_freem(m);
                              return;
                    }
          }
-------



More information about the Comp.unix.wizards mailing list