Skip to content

Commit

Permalink
Adjust static packets to build with GCC < 4.6
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 26, 2015
1 parent 82f5bb9 commit ca1a9d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 9 additions & 3 deletions cstp.c
Expand Up @@ -50,16 +50,22 @@ static const char data_hdr[8] = {
0 /* Unknown */
};

/* Strange initialisers here to work around GCC PR#10676 (which was
* fixed in GCC 4.6 but it takes a while for some systems to catch
* up. */
static const struct pkt keepalive_pkt = {
.cstp.hdr = { 'S', 'T', 'F', 1, 0, 0, AC_PKT_KEEPALIVE, 0 },
.next = NULL,
{ .cstp.hdr = { 'S', 'T', 'F', 1, 0, 0, AC_PKT_KEEPALIVE, 0 } }
};

static const struct pkt dpd_pkt = {
.cstp.hdr = { 'S', 'T', 'F', 1, 0, 0, AC_PKT_DPD_OUT, 0 },
.next = NULL,
{ .cstp.hdr = { 'S', 'T', 'F', 1, 0, 0, AC_PKT_DPD_OUT, 0 } }
};

static const struct pkt dpd_resp_pkt = {
.cstp.hdr = { 'S', 'T', 'F', 1, 0, 0, AC_PKT_DPD_RESP, 0 },
.next = NULL,
{ .cstp.hdr = { 'S', 'T', 'F', 1, 0, 0, AC_PKT_DPD_RESP, 0 } }
};

/* Calculate MTU to request. Old servers simply use the X-CSTP-MTU: header,
Expand Down
5 changes: 3 additions & 2 deletions oncp.c
Expand Up @@ -915,11 +915,12 @@ static const unsigned char esp_kmp_part2[] = {


static const struct pkt esp_enable_pkt = {
.oncp.hdr = {
.next = NULL,
{ .oncp.hdr = {
0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x2f, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0d
},
} },
.data = {
0x00, 0x06, 0x00, 0x00, 0x00, 0x07, /* Group 6, len 7 */
0x00, 0x01, 0x00, 0x00, 0x00, 0x01, /* Attr 1, len 1 */
Expand Down

0 comments on commit ca1a9d9

Please sign in to comment.