Changeset 2b0db98 in mainline for uspace/srv/net/il/arp/arp.c


Ignore:
Timestamp:
2011-01-07T14:02:56Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6986418
Parents:
d99120f (diff), 0f191a2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged development into lelian/hidd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/arp/arp.c

    rd99120f r2b0db98  
    483483        des_proto = des_hw + header->hardware_length;
    484484        trans = arp_addr_find(&proto->addresses, (char *) src_proto,
    485             CONVERT_SIZE(uint8_t, char, header->protocol_length));
     485            header->protocol_length);
    486486        /* Exists? */
    487487        if (trans && trans->hw_addr) {
    488                 if (trans->hw_addr->length != CONVERT_SIZE(uint8_t, char,
    489                     header->hardware_length)) {
     488                if (trans->hw_addr->length != header->hardware_length)
    490489                        return EINVAL;
    491                 }
    492490                memcpy(trans->hw_addr->value, src_hw, trans->hw_addr->length);
    493491        }
    494492        /* Is my protocol address? */
    495         if (proto->addr->length != CONVERT_SIZE(uint8_t, char,
    496             header->protocol_length)) {
     493        if (proto->addr->length != header->protocol_length)
    497494                return EINVAL;
    498         }
    499495        if (!str_lcmp(proto->addr->value, (char *) des_proto,
    500496            proto->addr->length)) {
     
    507503                        fibril_condvar_initialize(&trans->cv);
    508504                        rc = arp_addr_add(&proto->addresses, (char *) src_proto,
    509                             CONVERT_SIZE(uint8_t, char, header->protocol_length),
    510                             trans);
     505                            header->protocol_length, trans);
    511506                        if (rc != EOK) {
    512507                                /* The generic char map has already freed trans! */
     
    516511                if (!trans->hw_addr) {
    517512                        trans->hw_addr = measured_string_create_bulk(
    518                             (char *) src_hw, CONVERT_SIZE(uint8_t, char,
    519                             header->hardware_length));
     513                            (char *) src_hw, header->hardware_length);
    520514                        if (!trans->hw_addr)
    521515                                return ENOMEM;
     
    606600
    607601        /* ARP packet content size = header + (address + translation) * 2 */
    608         length = 8 + 2 * (CONVERT_SIZE(char, uint8_t, proto->addr->length) +
    609             CONVERT_SIZE(char, uint8_t, device->addr->length));
     602        length = 8 + 2 * (proto->addr->length + device->addr->length);
    610603        if (length > device->packet_dimension.content)
    611604                return ELIMIT;
     
    640633
    641634        rc = packet_set_addr(packet, (uint8_t *) device->addr->value,
    642             (uint8_t *) device->broadcast_addr->value,
    643             CONVERT_SIZE(char, uint8_t, device->addr->length));
     635            (uint8_t *) device->broadcast_addr->value, device->addr->length);
    644636        if (rc != EOK) {
    645637                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
Note: See TracChangeset for help on using the changeset viewer.