This commit is contained in:
Steffen Vogel 2017-12-20 10:38:06 +01:00
parent 612695e259
commit b576a66acc
3 changed files with 5 additions and 3 deletions

2
dist.c
View file

@ -39,7 +39,7 @@ int rtnl_netem_set_delay_distribution_data(struct rtnl_qdisc *qdisc, short *data
struct rtnl_netem *netem;
if (!(netem = rtnl_tc_data(TC_CAST(qdisc))))
BUG();
return -1;
if (len > MAXDIST)
return -NLE_INVAL;

View file

@ -23,8 +23,9 @@ uint16_t chksum_rfc1071(char *buf, size_t count)
/* This is the inner loop */
while (count > 1) {
sum += * (uint16_t) buf++;
sum += * (uint16_t *) buf;
count -= 2;
buf += 2;
}
/* Add left-over byte, if any */

View file

@ -9,6 +9,7 @@
#ifndef _UTILS_H_
#define _UTILS_H_
#include <stdint.h>
#include <stdarg.h>
#define MIN(x, y) ((x < y) ? x : y)
@ -22,7 +23,7 @@ void * alloc(size_t bytes);
*
* Source: RFC 1071
*/
uint16_t chksum_rfc1071(char *buf, size_t count)
uint16_t chksum_rfc1071(char *buf, size_t count);
/** Safely append a format string to an existing string.
*