u_short cleansing (should be u_int16_t)
This commit is contained in:
parent
eb78c879ca
commit
896f6ff227
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: igmp.c,v 1.7 2002/07/14 16:30:42 wiz Exp $ */
|
||||
/* $NetBSD: igmp.c,v 1.8 2002/08/01 03:40:34 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* The mrouted program is covered by the license in the accompanying file
|
||||
@ -316,7 +316,7 @@ send_igmp(u_int32_t src, u_int32_t dst, int type, int code, u_int32_t group,
|
||||
igmp->igmp_code = code;
|
||||
igmp->igmp_group.s_addr = group;
|
||||
igmp->igmp_cksum = 0;
|
||||
igmp->igmp_cksum = inet_cksum((u_short *)igmp,
|
||||
igmp->igmp_cksum = inet_cksum((u_int16_t *)igmp,
|
||||
IGMP_MINLEN + datalen);
|
||||
|
||||
if (IN_MULTICAST(ntohl(dst))) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: inet.c,v 1.5 2002/07/14 16:30:42 wiz Exp $ */
|
||||
/* $NetBSD: inet.c,v 1.6 2002/08/01 03:40:34 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* The mrouted program is covered by the license in the accompanying file
|
||||
@ -185,12 +185,12 @@ inet_parse(char *s)
|
||||
*
|
||||
*/
|
||||
int
|
||||
inet_cksum(u_short *addr, u_int len)
|
||||
inet_cksum(u_int16_t *addr, u_int len)
|
||||
{
|
||||
int nleft = (int)len;
|
||||
u_short *w = addr;
|
||||
u_short answer = 0;
|
||||
int sum = 0;
|
||||
u_int16_t *w = addr;
|
||||
u_int16_t answer = 0;
|
||||
int32_t sum = 0;
|
||||
|
||||
/*
|
||||
* Our algorithm is simple, using a 32 bit accumulator (sum),
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: snmp.c,v 1.6 2002/07/14 16:30:42 wiz Exp $ */
|
||||
/* $NetBSD: snmp.c,v 1.7 2002/08/01 03:40:34 itojun Exp $ */
|
||||
|
||||
#include "defs.h"
|
||||
#include <netinet/in_var.h>
|
||||
@ -9,7 +9,7 @@
|
||||
#define MROUTED
|
||||
#include "snmpd/snmp_vars.h"
|
||||
|
||||
u_short dest_port = 0;
|
||||
in_port_t dest_port = 0;
|
||||
int sdlen = 0;
|
||||
|
||||
struct addrCache {
|
||||
@ -27,7 +27,7 @@ static struct addrCache addrCache[10];
|
||||
*/
|
||||
int /* returns: 0 on success, true on error */
|
||||
snmp_init(dest_port)
|
||||
u_short dest_port;
|
||||
in_port_t dest_port;
|
||||
{
|
||||
u_long myaddr;
|
||||
int ret;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* $NetBSD: snmp.h,v 1.3 1995/12/10 10:07:18 mycroft Exp $ */
|
||||
/* $NetBSD: snmp.h,v 1.4 2002/08/01 03:40:34 itojun Exp $ */
|
||||
|
||||
extern int portlist[32], sdlen;
|
||||
extern u_short dest_port;
|
||||
extern in_port_t dest_port;
|
||||
extern int quantum;
|
||||
|
||||
extern int snmp_read_packet();
|
||||
|
Loading…
Reference in New Issue
Block a user