Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4:Update
radvd.import5316
bnc721968_9.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc721968_9.patch of Package radvd.import5316
References: bnc#721968 commit dd8fdaa88643056ce41f6fc68228ac1471f7ce05 Author: Reuben Hawkins <reubenhwk@gmail.com> Date: Thu Oct 6 08:37:09 2011 -0700 properly tracking buffer usage in rdnss commit 812ade3a8dde2cd9afba4d9f744222ad4c128f33 Author: Reuben Hawkins <reubenhwk@gmail.com> Date: Thu Oct 6 08:44:07 2011 -0700 starting off buffer usage tracking using send_ra_inc_len commit 0dac8110263c11b1e27c25aa868e2bd8ca3e728c Author: Reuben Hawkins <reubenhwk@gmail.com> Date: Thu Oct 6 08:40:30 2011 -0700 properly tracking buffer usage in prefix commit 37ab5a5fa784836d9e8440fc8f36addf2ca5676b Author: Reuben Hawkins <reubenhwk@gmail.com> Date: Thu Oct 6 08:39:43 2011 -0700 properly tracking buffer usage in route Index: radvd-1.3/send.c =================================================================== --- radvd-1.3.orig/send.c 2011-10-19 16:44:44.000000000 +0200 +++ radvd-1.3/send.c 2011-10-19 17:38:18.000000000 +0200 @@ -67,6 +67,17 @@ send_ra_forall(int sock, struct Interfac dlog(LOG_DEBUG, 5, "Not answering request from %s, not configured", address_text); } +static void +send_ra_inc_len(size_t *len, int add) +{ + *len += add; + if(*len >= MSG_SIZE) + { + flog(LOG_ERR, "Too many prefixes, routes, rdnss or dnssl to fit in buffer. Exiting."); + exit(1); + } +} + void send_ra(int sock, struct Interface *iface, struct in6_addr *dest) { @@ -131,6 +142,8 @@ send_ra(int sock, struct Interface *ifac memset(&buff, 0, sizeof(buff)); radvert = (struct nd_router_advert *) buff; + send_ra_inc_len(&len, sizeof(struct nd_router_advert)); + radvert->nd_ra_type = ND_ROUTER_ADVERT; radvert->nd_ra_code = 0; radvert->nd_ra_cksum = 0; @@ -152,8 +165,6 @@ send_ra(int sock, struct Interface *ifac radvert->nd_ra_reachable = htonl(iface->AdvReachableTime); radvert->nd_ra_retransmit = htonl(iface->AdvRetransTimer); - len = sizeof(struct nd_router_advert); - prefix = iface->AdvPrefixList; /* @@ -168,6 +179,8 @@ send_ra(int sock, struct Interface *ifac pinfo = (struct nd_opt_prefix_info *) (buff + len); + send_ra_inc_len(&len, sizeof(*pinfo)); + pinfo->nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION; pinfo->nd_opt_pi_len = 4; pinfo->nd_opt_pi_prefix_len = prefix->PrefixLen; @@ -187,7 +200,6 @@ send_ra(int sock, struct Interface *ifac memcpy(&pinfo->nd_opt_pi_prefix, &prefix->Prefix, sizeof(struct in6_addr)); - len += sizeof(*pinfo); } prefix = prefix->next; @@ -205,6 +217,8 @@ send_ra(int sock, struct Interface *ifac rinfo = (struct nd_opt_route_info_local *) (buff + len); + send_ra_inc_len(&len, sizeof(*rinfo)); + rinfo->nd_opt_ri_type = ND_OPT_ROUTE_INFORMATION; /* XXX: the prefixes are allowed to be sent in smaller chunks as well */ rinfo->nd_opt_ri_len = 3; @@ -216,7 +230,6 @@ send_ra(int sock, struct Interface *ifac memcpy(&rinfo->nd_opt_ri_prefix, &route->Prefix, sizeof(struct in6_addr)); - len += sizeof(*rinfo); route = route->next; } @@ -233,6 +246,8 @@ send_ra(int sock, struct Interface *ifac rdnssinfo = (struct nd_opt_rdnss_info_local *) (buff + len); + send_ra_inc_len(&len, sizeof(*rdnssinfo) - (3-rdnss->AdvRDNSSNumber)*sizeof(struct in6_addr)); + rdnssinfo->nd_opt_rdnssi_type = ND_OPT_RDNSS_INFORMATION; rdnssinfo->nd_opt_rdnssi_len = 1 + 2*rdnss->AdvRDNSSNumber; rdnssinfo->nd_opt_rdnssi_pref_flag_reserved = @@ -248,7 +263,6 @@ send_ra(int sock, struct Interface *ifac sizeof(struct in6_addr)); memcpy(&rdnssinfo->nd_opt_rdnssi_addr3, &rdnss->AdvRDNSSAddr3, sizeof(struct in6_addr)); - len += sizeof(*rdnssinfo) - (3-rdnss->AdvRDNSSNumber)*sizeof(struct in6_addr); rdnss = rdnss->next; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor