PATCH for correcting autype sequence

Sörös József soros at multip.hu
Sat Sep 13 00:21:22 CEST 2003


Hi,
Authentication type simple does not work, because bird sends 256 instead of
1 in auth type field.
The reason is the wrong byte order.
I suggest these corrections in proto/ospf/packet.c to fix this.
Best regards: Joseph


# diff -u ../../../tmp/bird-1.0.7/proto/ospf/packet.c packet.c
--- ../../../tmp/bird-1.0.7/proto/ospf/packet.c Thu Aug 14 10:13:14 2003
+++ packet.c    Fri Sep 12 23:50:45 2003
@@ -32,7 +32,7 @@
 ospf_tx_authenticate(struct ospf_iface *ifa, struct ospf_packet *pkt)
 {
   int i;
-  pkt->autype=ifa->autype;
+  pkt->autype=htons(ifa->autype);
   memcpy(pkt->authetication, ifa->aukey, 8);
   return;
 }
@@ -41,7 +41,7 @@
 ospf_rx_authenticate(struct ospf_iface *ifa, struct ospf_packet *pkt)
 {
   int i;
-  if(pkt->autype!=ifa->autype) return 0;
+  if(pkt->autype!=htons(ifa->autype)) return 0;
   if(ifa->autype==AU_NONE) return 1;
   if(ifa->autype==AU_SIMPLE)
   {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20030913/fc6997d6/attachment.html>


More information about the Bird-users mailing list