~ubuntu-branches/ubuntu/wily/dhcpcd5/wily-proposed

« back to all changes in this revision

Viewing changes to bpf.c

  • Committer: Bazaar Package Importer
  • Author(s): Roy Marples
  • Date: 2011-03-06 10:16:22 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110306101622-lhkyhvv9u9rm2qpw
Tags: 5.2.12-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * dhcpcd - DHCP client daemon
3
 
 * Copyright (c) 2006-2008 Roy Marples <roy@marples.name>
 
3
 * Copyright (c) 2006-2011 Roy Marples <roy@marples.name>
4
4
 *
5
5
 * Redistribution and use in source and binary forms, with or without
6
6
 * modification, are permitted provided that the following conditions
160
160
 * So we pass the buffer in the API so we can loop on >1 packet. */
161
161
ssize_t
162
162
get_raw_packet(struct interface *iface, int protocol,
163
 
    void *data, ssize_t len)
 
163
    void *data, ssize_t len, int *partialcsum)
164
164
{
165
165
        int fd = -1;
166
166
        struct bpf_hdr packet;
172
172
        else
173
173
                fd = iface->raw_fd;
174
174
 
 
175
        if (partialcsum != NULL)
 
176
                *partialcsum = 0; /* Not supported on BSD */
 
177
 
175
178
        for (;;) {
176
179
                if (iface->buffer_len == 0) {
177
180
                        bytes = read(fd, iface->buffer, iface->buffer_size);