"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "rsrr.c" between
mrouted-3.9.7.tar.gz and mrouted-3.9.8.tar.gz

About: mrouted is an implementation of the DVMRP multicast routing protocol.

rsrr.c  (mrouted-3.9.7):rsrr.c  (mrouted-3.9.8)
skipping to change at line 71 skipping to change at line 71
static void rsrr_read(int); static void rsrr_read(int);
static int rsrr_send(int sendlen); static int rsrr_send(int sendlen);
static void rsrr_cache(struct gtable *gt, struct rsrr_rq *route_query); static void rsrr_cache(struct gtable *gt, struct rsrr_rq *route_query);
/* Initialize RSRR socket */ /* Initialize RSRR socket */
void rsrr_init(void) void rsrr_init(void)
{ {
int servlen; int servlen;
struct sockaddr_un serv_addr; struct sockaddr_un serv_addr;
rsrr_recv_buf = (char *)malloc(RSRR_MAX_LEN); rsrr_recv_buf = malloc(RSRR_MAX_LEN);
rsrr_send_buf = (char *)malloc(RSRR_MAX_LEN); rsrr_send_buf = malloc(RSRR_MAX_LEN);
if (!rsrr_recv_buf || !rsrr_send_buf) if (!rsrr_recv_buf || !rsrr_send_buf) {
logit(LOG_ERR, 0, "Ran out of memory in rsrr_init()"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__, __
func__);
return;
}
if ((rsrr_socket = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) rsrr_socket = socket(AF_UNIX, SOCK_DGRAM, 0);
logit(LOG_ERR, errno, "Cannot create RSRR socket"); if (rsrr_socket < 0) {
logit(LOG_ERR, errno, "Failed creating RSRR socket");
return;
}
unlink(RSRR_SERV_PATH); unlink(RSRR_SERV_PATH);
memset(&serv_addr, 0, sizeof(serv_addr)); memset(&serv_addr, 0, sizeof(serv_addr));
serv_addr.sun_family = AF_UNIX; serv_addr.sun_family = AF_UNIX;
strlcpy(serv_addr.sun_path, RSRR_SERV_PATH, sizeof(serv_addr.sun_path)); strlcpy(serv_addr.sun_path, RSRR_SERV_PATH, sizeof(serv_addr.sun_path));
#ifdef HAVE_SA_LEN #ifdef HAVE_SA_LEN
servlen = offsetof(struct sockaddr_un, sun_path) + strlen(serv_addr.sun_path ); servlen = offsetof(struct sockaddr_un, sun_path) + strlen(serv_addr.sun_path );
serv_addr.sun_len = servlen; serv_addr.sun_len = servlen;
#else #else
servlen = sizeof(serv_addr.sun_family) + strlen(serv_addr.sun_path); servlen = sizeof(serv_addr.sun_family) + strlen(serv_addr.sun_path);
skipping to change at line 391 skipping to change at line 396
return; return;
} }
rcnp = &rc->next; rcnp = &rc->next;
} }
/* Cache entry doesn't already exist. Create one and insert at /* Cache entry doesn't already exist. Create one and insert at
* front of list. * front of list.
*/ */
rc = (struct rsrr_cache *)malloc(sizeof(struct rsrr_cache)); rc = malloc(sizeof(struct rsrr_cache));
if (!rc) { if (!rc) {
logit(LOG_ERR, errno, "Ran out of memory in rsrr_cache()"); logit(LOG_ERR, errno, "Failed allocating memory in %s:%s()", __FILE__, __
return; /* Never reached */ func__);
return;
} }
rc->route_query.source_addr.s_addr = route_query->source_addr.s_addr; rc->route_query.source_addr.s_addr = route_query->source_addr.s_addr;
rc->route_query.dest_addr.s_addr = route_query->dest_addr.s_addr; rc->route_query.dest_addr.s_addr = route_query->dest_addr.s_addr;
rc->route_query.query_id = route_query->query_id; rc->route_query.query_id = route_query->query_id;
strlcpy(rc->client_addr.sun_path, client_addr.sun_path, sizeof(rc->client_ad dr.sun_path)); strlcpy(rc->client_addr.sun_path, client_addr.sun_path, sizeof(rc->client_ad dr.sun_path));
rc->client_length = client_length; rc->client_length = client_length;
rc->next = gt->gt_rsrr_cache; rc->next = gt->gt_rsrr_cache;
gt->gt_rsrr_cache = rc; gt->gt_rsrr_cache = rc;
 End of changes. 4 change blocks. 
9 lines changed or deleted 16 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS