Changeset 081971b in mainline for uspace/srv/ethip/pdu.c


Ignore:
Timestamp:
2012-02-13T23:10:29Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
87e5658c
Parents:
2ff150e
Message:

Need to pad short Ethernet frames. Add some more debugging code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ethip/pdu.c

    r2ff150e r081971b  
    3838#include <errno.h>
    3939#include <io/log.h>
     40#include <macros.h>
    4041#include <mem.h>
    4142#include <stdlib.h>
     
    5758        eth_header_t *hdr;
    5859
    59         size = sizeof(eth_header_t) + frame->size;
     60        size = max(sizeof(eth_header_t) + frame->size, ETH_FRAME_MIN_SIZE);
    6061
    6162        data = calloc(size, 1);
     
    122123
    123124        val = addr->addr;
    124         for (i = 0; i < MAC48_BYTES; i++) {
     125        for (i = 0; i < MAC48_BYTES; i++)
    125126                bbuf[i] = (val >> (8 * (MAC48_BYTES - i - 1))) & 0xff;
    126                 val = val >> 8;
    127         }
    128127}
    129128
Note: See TracChangeset for help on using the changeset viewer.