Revision 1155c792

View differences:

proto/ospf/packet.c
60 60
  struct MD5Context ctxt;
61 61
  char password[OSPF_AUTH_CRYPT_SIZE];
62 62

  
63
  pkt->checksum = 0;
63 64
  pkt->autype = htons(ifa->autype);
65
  bzero(&pkt->u, sizeof(union ospf_auth));
66

  
67
  /* Compatibility note: pkt->u may contain anything if autype is
68
     none, but nonzero values do not work with Mikrotik OSPF */
64 69

  
65 70
  switch(ifa->autype)
66 71
  {
67 72
    case OSPF_AUTH_SIMPLE:
68
      bzero(&pkt->u, sizeof(union ospf_auth));
69 73
      passwd = password_find(ifa->passwords, 1);
70 74
      if (!passwd)
71 75
      {
......
74 78
      }
75 79
      password_cpy(pkt->u.password, passwd->password, sizeof(union ospf_auth));
76 80
    case OSPF_AUTH_NONE:
77
      pkt->checksum = 0;
78 81
      pkt->checksum = ipsum_calculate(pkt, sizeof(struct ospf_packet) -
79 82
                                  sizeof(union ospf_auth), (pkt + 1),
80 83
				  ntohs(pkt->length) -
......
88 91
        return;
89 92
      }
90 93

  
91
      pkt->checksum = 0;
92

  
93 94
      /* Perhaps use random value to prevent replay attacks after
94 95
	 reboot when system does not have independent RTC? */
95 96
      if (!ifa->csn)

Also available in: Unified diff