[Olsr-cvs] olsrd-current/src net_olsr.c,1.8,1.9
Andreas T�nnesen
(spam-protected)
Fri Jan 6 08:21:07 CET 2006
- Previous message: [Olsr-cvs] olsrd-current/src net_olsr.h,1.1,1.2
- Next message: [Olsr-cvs] olsrd-current/src build_msg.c, 1.31, 1.32 build_msg.h, 1.12, 1.13 defs.c, 1.1, 1.2 defs.h, 1.51, 1.52 generate_msg.c, 1.23, 1.24 interfaces.c, 1.27, 1.28 interfaces.h, 1.31, 1.32 ipc_frontend.c, 1.27, 1.28 link_set.c, 1.62, 1.63 local_hna_set.c, 1.10, 1.11 lq_mpr.c, 1.10, 1.11 lq_packet.c, 1.19, 1.20 lq_route.c, 1.40, 1.41 main.c, 1.83, 1.84 mpr.c, 1.14, 1.15 mpr_selector_set.c, 1.14, 1.15 neighbor_table.c, 1.29, 1.30 net_olsr.c, 1.9, 1.10 net_olsr.h, 1.2, 1.3 olsr.c, 1.47, 1.48 olsr_cfg.h, 1.28, 1.29 olsr_protocol.h, 1.19, 1.20 packet.c, 1.20, 1.21 parser.c, 1.29, 1.30 parser.h, 1.10, 1.11 print_packet.c, 1.8, 1.9 process_package.c, 1.36, 1.37 scheduler.c, 1.33, 1.34 scheduler.h, 1.11, 1.12 tc_set.c, 1.23, 1.24
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23197
Modified Files:
net_olsr.c
Log Message:
Added dont fragment bit in libnet udp header and better failure handling
Index: net_olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** net_olsr.c 6 Jan 2006 06:54:04 -0000 1.8
--- net_olsr.c 6 Jan 2006 07:21:04 -0000 1.9
***************
*** 410,413 ****
--- 410,414 ----
struct ptf *tmp_ptf_list;
union olsr_packet *outmsg;
+ int retval;
sin = NULL;
***************
*** 422,425 ****
--- 423,428 ----
netbufs[ifp->if_nr]->pending += OLSR_HEADERSIZE;
+ retval = netbufs[ifp->if_nr]->pending;
+
outmsg = (union olsr_packet *)netbufs[ifp->if_nr]->buff;
/* Add the Packet seqno */
***************
*** 471,475 ****
#ifdef USE_LIBNET
libnet_ptag_t udp_ptag = 0, ip_ptag = 0;
- int bytes_written;
printf("LIBNET TX %d bytes on %s\n",
--- 474,477 ----
***************
*** 489,493 ****
{
OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx))
! return (0);
}
--- 491,497 ----
{
OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx))
! netbufs[ifp->if_nr]->pending = 0;
! libnet_clear_packet(ifp->libnet_ctx);
! return -1;
}
***************
*** 495,499 ****
olsr_cnf->tos,
ifp->olsr_seqnum,
! 0,
255,
IPPROTO_UDP,
--- 499,503 ----
olsr_cnf->tos,
ifp->olsr_seqnum,
! 0x4000, /* Don't fragment */
255,
IPPROTO_UDP,
***************
*** 508,523 ****
{
OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx))
! return (0);
}
! if((bytes_written = libnet_write(ifp->libnet_ctx)) == -1)
{
OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx))
- return (0);
}
! if(bytes_written != (int)(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending))
{
printf("libnet_write returned %d, expected %d\n",
! bytes_written, LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending);
}
--- 512,528 ----
{
OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx))
! netbufs[ifp->if_nr]->pending = 0;
! libnet_clear_packet(ifp->libnet_ctx);
! return -1;
}
! if((retval = libnet_write(ifp->libnet_ctx)) == -1)
{
OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx))
}
! if(retval != (int)(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending))
{
printf("libnet_write returned %d, expected %d\n",
! retval, LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending);
}
***************
*** 535,540 ****
perror("sendto(v4)");
olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m");
! netbufs[ifp->if_nr]->pending = 0;
! return -1;
}
#endif
--- 540,544 ----
perror("sendto(v4)");
olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m");
! retval = -1;
}
#endif
***************
*** 556,561 ****
fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6));
fprintf(stderr, "Outputsize: %d\n", netbufs[ifp->if_nr]->pending);
! netbufs[ifp->if_nr]->pending = 0;
! return -1;
}
}
--- 560,564 ----
fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6));
fprintf(stderr, "Outputsize: %d\n", netbufs[ifp->if_nr]->pending);
! retval = -1;
}
}
***************
*** 569,573 ****
lq_tc_pending = OLSR_FALSE;
! return 1;
}
--- 572,576 ----
lq_tc_pending = OLSR_FALSE;
! return retval;
}
- Previous message: [Olsr-cvs] olsrd-current/src net_olsr.h,1.1,1.2
- Next message: [Olsr-cvs] olsrd-current/src build_msg.c, 1.31, 1.32 build_msg.h, 1.12, 1.13 defs.c, 1.1, 1.2 defs.h, 1.51, 1.52 generate_msg.c, 1.23, 1.24 interfaces.c, 1.27, 1.28 interfaces.h, 1.31, 1.32 ipc_frontend.c, 1.27, 1.28 link_set.c, 1.62, 1.63 local_hna_set.c, 1.10, 1.11 lq_mpr.c, 1.10, 1.11 lq_packet.c, 1.19, 1.20 lq_route.c, 1.40, 1.41 main.c, 1.83, 1.84 mpr.c, 1.14, 1.15 mpr_selector_set.c, 1.14, 1.15 neighbor_table.c, 1.29, 1.30 net_olsr.c, 1.9, 1.10 net_olsr.h, 1.2, 1.3 olsr.c, 1.47, 1.48 olsr_cfg.h, 1.28, 1.29 olsr_protocol.h, 1.19, 1.20 packet.c, 1.20, 1.21 parser.c, 1.29, 1.30 parser.h, 1.10, 1.11 print_packet.c, 1.8, 1.9 process_package.c, 1.36, 1.37 scheduler.c, 1.33, 1.34 scheduler.h, 1.11, 1.12 tc_set.c, 1.23, 1.24
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Olsr-cvs
mailing list