Skip to content

Commit

Permalink
Merge pull request iovisor#1341 from pbhole/fix_http_filter
Browse files Browse the repository at this point in the history
examples: fixed http_filter example
  • Loading branch information
yonghong-song committed Sep 5, 2017
2 parents ac1334f + ec60e75 commit a3abb65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/networking/http_filter/http-parse-complete.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ int http_filter(struct __sk_buff *skb) {
unsigned long p[7];
int i = 0;
int j = 0;
for (i = payload_offset ; i < (payload_offset + 7) ; i++) {
const int last_index = payload_offset + 7;
for (i = payload_offset ; i < last_index ; i++) {
p[j] = load_byte(skb , i);
j++;
}
Expand Down
3 changes: 2 additions & 1 deletion examples/networking/http_filter/http-parse-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ int http_filter(struct __sk_buff *skb) {
unsigned long p[7];
int i = 0;
int j = 0;
for (i = payload_offset ; i < (payload_offset + 7) ; i++) {
const int last_index = payload_offset + 7;
for (i = payload_offset ; i < last_index ; i++) {
p[j] = load_byte(skb , i);
j++;
}
Expand Down

0 comments on commit a3abb65

Please sign in to comment.